<?php
$operations = Blyn::app()->getActiveServiceApp()->getUserOperations();

$items = array();

foreach ($operations as $id => $opp) {
    if ($opp->getDisplayName() != "joinService") {
        $item = array();
        $item['url'] = $opp->getUIManager()->getUrl(array('ajaxLink' => array('name' => $opp->getDisplayName())));
        //$item['url'] = $opp->getUIManager()->getUrl();
        $item['label'] = $opp->getDisplayName();
        $item['active'] = '';
        //$item['active'] = FALSE;

        $activeOperation = Blyn::app()->getActiveOperation();

        if ($activeOperation instanceof BOperation && $opp->getId() == $activeOperation->getId())
            $item['active'] = 'active';
        // $item['active'] = TRUE;

        array_push($items, $item);
    }
}
?>

<ul class="nav nav-pills">
    <?php foreach ($items as $item) { ?>
        <li class=<?php echo $item['active']; ?>>
            <?php echo $item['url']; ?>
        </li>  
    <?php } ?>
</ul>


<?php
/*
  $this->widget('bootstrap.widgets.TbMenu', array(
  'type' => 'pills', // '', 'tabs', 'pills' (or 'list')
  'stacked' => false, // whether this is a stacked menu
  'items' => $items
  ));
 * 
 */
?>

